char * convert_human_time_format(const char *human_timef); /* "HH+mm+ss" -> "%H+%M+%S" */
char * pretty_deg_format(double lat, double lon, char fmt, int html); /* decimal -> dd.dddd or dd mm.mmm or dd mm ss */
+char * get_filename(const char *fname); /* extract the filename portion */
+
/*
* Character encoding transformations.
*/
}
return result;
}
+
+char *get_filename(const char *fname)
+{
+ char *res, *cb, *cs;
+
+ cb = strrchr(fname, '\\');
+ cs = strrchr(fname, '/');
+
+ if (cb == NULL) res = cs;
+ else if (cs == NULL) res = cb;
+ else res = (cs > cb) ? cs : cb;
+
+ return (res == NULL) ? (char *) fname : ++res;
+}